const { build, pause, concat } = require('../build');

var files = [
	"system",
	"uart",
  //"tjpeg",
	"divsi3",
  "tlsf",
];
var cppfiles = [
	"3d",
	"ArrayList",
  "ch375b",
  "Sd2Card",
  //"FileSystem",
  //"windows",
];

var proc = async () => {
	var hardFloat = process.argv[2] == "hardFloat";
	var param = ["-I./glibc"];

	var targets = [];
	for (var i = 0; i < files.length; i++) {
		var ret = await build("lib/" + files[i], hardFloat, false, param);
		targets.push(ret);
	}
	for (var i = 0; i < cppfiles.length; i++) {
		var ret = await build("lib/" + cppfiles[i], hardFloat, true, param);
		targets.push(ret);
	}

	concat(targets, "lib.s");

  console.log("finish");
	//pause();
}
proc();

//setTimeout(() => { }, 100000);
